{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def test_connection():\n",
    "    return True\n",
    "\n",
    "def get():\n",
    "    return []\n",
    "\n",
    "def get_user_list():\n",
    "    if not test_connection():\n",
    "        return None\n",
    "    else:\n",
    "        # return user list\n",
    "        return get()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "user list []\n"
     ]
    }
   ],
   "source": [
    "user_list = get_user_list()\n",
    "if user_list is None:\n",
    "    print('connection error')\n",
    "else:\n",
    "    print('user list', user_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    ""
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
